Telegram Group & Telegram Channel
33. Number pattern 8.

5
11111
0000
111
00
1


import java.util.Scanner;

class Pattern
{
public static void main(String args[])
{
int n, i, j;
Scanner sc = new Scanner(System.in);

System.out.println("Enter the number of rows ");
n = sc.nextInt();

for (i = 1; i <= n; i++)
{
for (j = i; j <= n; j++)
{
if (i % 2 == 0)
System.out.print("0");
else
System.out.print("1");
}
System.out.println();
}
}
}

@java_codings



tg-me.com/java_codings/45
Create:
Last Update:

33. Number pattern 8.

5
11111
0000
111
00
1


import java.util.Scanner;

class Pattern
{
public static void main(String args[])
{
int n, i, j;
Scanner sc = new Scanner(System.in);

System.out.println("Enter the number of rows ");
n = sc.nextInt();

for (i = 1; i <= n; i++)
{
for (j = i; j <= n; j++)
{
if (i % 2 == 0)
System.out.print("0");
else
System.out.print("1");
}
System.out.println();
}
}
}

@java_codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/45

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. β€œThey have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. β€œIt’s huge.”

Advance Java ‍ from kr


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA